\(\int \frac {A+B x^2}{x^2 (a+b x^2)^2} \, dx\) [82]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 71 \[ \int \frac {A+B x^2}{x^2 \left (a+b x^2\right )^2} \, dx=-\frac {A}{a^2 x}-\frac {(A b-a B) x}{2 a^2 \left (a+b x^2\right )}-\frac {(3 A b-a B) \arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{2 a^{5/2} \sqrt {b}} \]

[Out]

-A/a^2/x-1/2*(A*b-B*a)*x/a^2/(b*x^2+a)-1/2*(3*A*b-B*a)*arctan(x*b^(1/2)/a^(1/2))/a^(5/2)/b^(1/2)

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {467, 464, 211} \[ \int \frac {A+B x^2}{x^2 \left (a+b x^2\right )^2} \, dx=-\frac {(3 A b-a B) \arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{2 a^{5/2} \sqrt {b}}-\frac {x (A b-a B)}{2 a^2 \left (a+b x^2\right )}-\frac {A}{a^2 x} \]

[In]

Int[(A + B*x^2)/(x^2*(a + b*x^2)^2),x]

[Out]

-(A/(a^2*x)) - ((A*b - a*B)*x)/(2*a^2*(a + b*x^2)) - ((3*A*b - a*B)*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/(2*a^(5/2)*Sq
rt[b])

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 464

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[c*(e*x)^(m +
 1)*((a + b*x^n)^(p + 1)/(a*e*(m + 1))), x] + Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(a*e^n*(m + 1)), In
t[(e*x)^(m + n)*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, p}, x] && NeQ[b*c - a*d, 0] && (IntegerQ[n] ||
GtQ[e, 0]) && ((GtQ[n, 0] && LtQ[m, -1]) || (LtQ[n, 0] && GtQ[m + n, -1])) &&  !ILtQ[p, -1]

Rule 467

Int[(x_)^(m_)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[(-a)^(m/2 - 1)*(b*c - a*d)*x
*((a + b*x^2)^(p + 1)/(2*b^(m/2 + 1)*(p + 1))), x] + Dist[1/(2*b^(m/2 + 1)*(p + 1)), Int[x^m*(a + b*x^2)^(p +
1)*ExpandToSum[2*b*(p + 1)*Together[(b^(m/2)*(c + d*x^2) - (-a)^(m/2 - 1)*(b*c - a*d)*x^(-m + 2))/(a + b*x^2)]
 - ((-a)^(m/2 - 1)*(b*c - a*d))/x^m, x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] &
& ILtQ[m/2, 0] && (IntegerQ[p] || EqQ[m + 2*p + 1, 0])

Rubi steps \begin{align*} \text {integral}& = -\frac {(A b-a B) x}{2 a^2 \left (a+b x^2\right )}-\frac {1}{2} \int \frac {-\frac {2 A}{a}+\frac {(A b-a B) x^2}{a^2}}{x^2 \left (a+b x^2\right )} \, dx \\ & = -\frac {A}{a^2 x}-\frac {(A b-a B) x}{2 a^2 \left (a+b x^2\right )}-\frac {(3 A b-a B) \int \frac {1}{a+b x^2} \, dx}{2 a^2} \\ & = -\frac {A}{a^2 x}-\frac {(A b-a B) x}{2 a^2 \left (a+b x^2\right )}-\frac {(3 A b-a B) \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{2 a^{5/2} \sqrt {b}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.99 \[ \int \frac {A+B x^2}{x^2 \left (a+b x^2\right )^2} \, dx=-\frac {A}{a^2 x}+\frac {(-A b+a B) x}{2 a^2 \left (a+b x^2\right )}+\frac {(-3 A b+a B) \arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{2 a^{5/2} \sqrt {b}} \]

[In]

Integrate[(A + B*x^2)/(x^2*(a + b*x^2)^2),x]

[Out]

-(A/(a^2*x)) + ((-(A*b) + a*B)*x)/(2*a^2*(a + b*x^2)) + ((-3*A*b + a*B)*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/(2*a^(5/2
)*Sqrt[b])

Maple [A] (verified)

Time = 2.52 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.87

method result size
default \(-\frac {A}{a^{2} x}-\frac {\frac {\left (\frac {A b}{2}-\frac {B a}{2}\right ) x}{b \,x^{2}+a}+\frac {\left (3 A b -B a \right ) \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{2 \sqrt {a b}}}{a^{2}}\) \(62\)
risch \(\frac {-\frac {\left (3 A b -B a \right ) x^{2}}{2 a^{2}}-\frac {A}{a}}{x \left (b \,x^{2}+a \right )}-\frac {3 \ln \left (-\sqrt {-a b}\, x -a \right ) A b}{4 \sqrt {-a b}\, a^{2}}+\frac {\ln \left (-\sqrt {-a b}\, x -a \right ) B}{4 \sqrt {-a b}\, a}+\frac {3 \ln \left (-\sqrt {-a b}\, x +a \right ) A b}{4 \sqrt {-a b}\, a^{2}}-\frac {\ln \left (-\sqrt {-a b}\, x +a \right ) B}{4 \sqrt {-a b}\, a}\) \(141\)

[In]

int((B*x^2+A)/x^2/(b*x^2+a)^2,x,method=_RETURNVERBOSE)

[Out]

-A/a^2/x-1/a^2*((1/2*A*b-1/2*B*a)*x/(b*x^2+a)+1/2*(3*A*b-B*a)/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2)))

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 210, normalized size of antiderivative = 2.96 \[ \int \frac {A+B x^2}{x^2 \left (a+b x^2\right )^2} \, dx=\left [-\frac {4 \, A a^{2} b - 2 \, {\left (B a^{2} b - 3 \, A a b^{2}\right )} x^{2} - {\left ({\left (B a b - 3 \, A b^{2}\right )} x^{3} + {\left (B a^{2} - 3 \, A a b\right )} x\right )} \sqrt {-a b} \log \left (\frac {b x^{2} + 2 \, \sqrt {-a b} x - a}{b x^{2} + a}\right )}{4 \, {\left (a^{3} b^{2} x^{3} + a^{4} b x\right )}}, -\frac {2 \, A a^{2} b - {\left (B a^{2} b - 3 \, A a b^{2}\right )} x^{2} - {\left ({\left (B a b - 3 \, A b^{2}\right )} x^{3} + {\left (B a^{2} - 3 \, A a b\right )} x\right )} \sqrt {a b} \arctan \left (\frac {\sqrt {a b} x}{a}\right )}{2 \, {\left (a^{3} b^{2} x^{3} + a^{4} b x\right )}}\right ] \]

[In]

integrate((B*x^2+A)/x^2/(b*x^2+a)^2,x, algorithm="fricas")

[Out]

[-1/4*(4*A*a^2*b - 2*(B*a^2*b - 3*A*a*b^2)*x^2 - ((B*a*b - 3*A*b^2)*x^3 + (B*a^2 - 3*A*a*b)*x)*sqrt(-a*b)*log(
(b*x^2 + 2*sqrt(-a*b)*x - a)/(b*x^2 + a)))/(a^3*b^2*x^3 + a^4*b*x), -1/2*(2*A*a^2*b - (B*a^2*b - 3*A*a*b^2)*x^
2 - ((B*a*b - 3*A*b^2)*x^3 + (B*a^2 - 3*A*a*b)*x)*sqrt(a*b)*arctan(sqrt(a*b)*x/a))/(a^3*b^2*x^3 + a^4*b*x)]

Sympy [A] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.61 \[ \int \frac {A+B x^2}{x^2 \left (a+b x^2\right )^2} \, dx=- \frac {\sqrt {- \frac {1}{a^{5} b}} \left (- 3 A b + B a\right ) \log {\left (- a^{3} \sqrt {- \frac {1}{a^{5} b}} + x \right )}}{4} + \frac {\sqrt {- \frac {1}{a^{5} b}} \left (- 3 A b + B a\right ) \log {\left (a^{3} \sqrt {- \frac {1}{a^{5} b}} + x \right )}}{4} + \frac {- 2 A a + x^{2} \left (- 3 A b + B a\right )}{2 a^{3} x + 2 a^{2} b x^{3}} \]

[In]

integrate((B*x**2+A)/x**2/(b*x**2+a)**2,x)

[Out]

-sqrt(-1/(a**5*b))*(-3*A*b + B*a)*log(-a**3*sqrt(-1/(a**5*b)) + x)/4 + sqrt(-1/(a**5*b))*(-3*A*b + B*a)*log(a*
*3*sqrt(-1/(a**5*b)) + x)/4 + (-2*A*a + x**2*(-3*A*b + B*a))/(2*a**3*x + 2*a**2*b*x**3)

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.89 \[ \int \frac {A+B x^2}{x^2 \left (a+b x^2\right )^2} \, dx=\frac {{\left (B a - 3 \, A b\right )} x^{2} - 2 \, A a}{2 \, {\left (a^{2} b x^{3} + a^{3} x\right )}} + \frac {{\left (B a - 3 \, A b\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{2 \, \sqrt {a b} a^{2}} \]

[In]

integrate((B*x^2+A)/x^2/(b*x^2+a)^2,x, algorithm="maxima")

[Out]

1/2*((B*a - 3*A*b)*x^2 - 2*A*a)/(a^2*b*x^3 + a^3*x) + 1/2*(B*a - 3*A*b)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*a^2)

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.87 \[ \int \frac {A+B x^2}{x^2 \left (a+b x^2\right )^2} \, dx=\frac {{\left (B a - 3 \, A b\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{2 \, \sqrt {a b} a^{2}} + \frac {B a x^{2} - 3 \, A b x^{2} - 2 \, A a}{2 \, {\left (b x^{3} + a x\right )} a^{2}} \]

[In]

integrate((B*x^2+A)/x^2/(b*x^2+a)^2,x, algorithm="giac")

[Out]

1/2*(B*a - 3*A*b)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*a^2) + 1/2*(B*a*x^2 - 3*A*b*x^2 - 2*A*a)/((b*x^3 + a*x)*a^2
)

Mupad [B] (verification not implemented)

Time = 4.92 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.89 \[ \int \frac {A+B x^2}{x^2 \left (a+b x^2\right )^2} \, dx=-\frac {\frac {A}{a}+\frac {x^2\,\left (3\,A\,b-B\,a\right )}{2\,a^2}}{b\,x^3+a\,x}-\frac {\mathrm {atan}\left (\frac {\sqrt {b}\,x}{\sqrt {a}}\right )\,\left (3\,A\,b-B\,a\right )}{2\,a^{5/2}\,\sqrt {b}} \]

[In]

int((A + B*x^2)/(x^2*(a + b*x^2)^2),x)

[Out]

- (A/a + (x^2*(3*A*b - B*a))/(2*a^2))/(a*x + b*x^3) - (atan((b^(1/2)*x)/a^(1/2))*(3*A*b - B*a))/(2*a^(5/2)*b^(
1/2))